package com.smartens.boit.activity;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;

import com.smartens.boit.R;
import com.smartens.boit.base.BaseActivity;

public class FaultFollowActivity extends BaseActivity {
    private TextView submit;
    private LinearLayout back;
    private RadioButton radioButton1;
    private RadioButton radioButton2;
    private EditText editText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fault_follow);
        submit = findViewById(R.id.submit);
        back = findViewById(R.id.back);
        radioButton1 = findViewById(R.id.rb_01);
        radioButton2 = findViewById(R.id.rb_02);
        editText = findViewById(R.id.edit);
        radioButton1.setChecked(true);
        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(FaultFollowActivity.this,FaultDetailActivity.class);

                String a = radioButton1.isChecked()?"未处理":"已处理";
                intent.putExtra("status",a);
                intent.putExtra("remarks", editText.getText().toString().length()>0 ?editText.getText().toString():"");
                startActivityForResult(intent,1);
           //     FaultFollowActivity.this.finish();
               // setResult(1);
            }
        });
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                FaultFollowActivity.this.finish();
            }
        });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        setResult(resultCode);
        FaultFollowActivity.this.finish();
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }
}